package test1225;

public class Test10 {
    public static void main(String[] args) {
        int[] arr = {4, 5, 6, 7, 8, 9};
        int[] brr = m10(arr);
        for (int i = 0; i < brr.length; i++) {
            System.out.println(brr[i]);
        }
    }


    public static int[] m10(int[] arr) {
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] % 2 == 0) {
                count++;
            }
        }
        int[] x = new int[count];
        int index = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] % 2 == 0) {
                x[index] = arr[i];
                index++;
            }
        }
        return x;
    }
}
